#ifndef _PVMLOGGINGAPI_H_
#define _PVMLOGGINGAPI_H_

/*
 This API controls logging in PVM library
*/

#include "pvm/pvmdefs.h"
#include "pvm/pvmtypes.h"

#if defined(__cplusplus)
extern "C"
{
#endif/*__cplusplus*/


/*
	Logging
*/

enum PVMLOG_EVENT_TYPE
{
	PVMLOG_EVENT_ERROR = 1,
	PVMLOG_EVENT_WARNING = 2,
	PVMLOG_EVENT_INFO = 4
};

enum PVMLOG_FLAGS_CONSTS
{
	PVMLOG_EVENT_NONE = 0,
	PVMLOG_EVENT_ALL = (PVMLOG_EVENT_ERROR | PVMLOG_EVENT_WARNING | PVMLOG_EVENT_INFO),
	PVMLOG_EVENT_MASK = PVMLOG_EVENT_ALL
};

enum PVMLOG_COMPONENT
{
	PVMLOG_COMPONENT_OTHER = 1,
	PVMLOG_COMPONENT_MEMORY = 2,
	PVMLOG_COMPONENT_DEVICE = 4,
	PVMLOG_COMPONENT_DRIVER = 8,
	PVMLOG_COMPONENT_MIXING = 16
};

enum PVMLOG_COMPONENT_CONSTS
{
	PVMLOG_COMPONENT_ALL = 0xFFFFFFFF,
	PVMLOG_COMPONENT_MASK = PVMLOG_COMPONENT_ALL
};

typedef void PVMCALL (*PVMLogOutFunction)(const pvm_char* logString);

PVMAPI void PVMCALL PVMLogEnable(pvm_bool enabled);
PVMAPI pvm_bool PVMCALL PVMLogIsEnabled();

PVMAPI void PVMCALL PVMLogSetEventMask(pvm_int32 mask);
PVMAPI pvm_int PVMCALL PVMLogGetEventlMask();

PVMAPI void PVMCALL PVMLogComponentsEnable(pvm_int32 components, pvm_bool state);
PVMAPI pvm_int32 PVMCALL PVMLogGetComponentsState();

PVMAPI void PVMCALL PVMLogLogSourceEnable(pvm_bool enabled);
PVMAPI pvm_bool PVMCALL PVMLogLogSourceEnableIsEnabled();

PVMAPI PVMLogOutFunction PVMCALL PVMLogGetDefaultOutFunction();
PVMAPI PVMLogOutFunction PVMCALL PVMLogGetOutFunction();
PVMAPI pvm_bool PVMCALL PVMLogSetOutFunction(PVMLogOutFunction logOutFunction);

#if defined(__cplusplus)
}
#endif/*__cplusplus*/

#endif